// 缓存管理页面样式
.cache-management {
    padding: 20px;
}

.page-header {
    margin-bottom: 30px;
    h1 {
        margin: 0 0 10px 0;
        color: #1f2937;
    }
    p {
        margin: 0;
        color: #6b7280;
    }
}

.management-content {
    .sample-data-notice {
        margin-bottom: 20px;
        
        .el-alert {
            border-radius: 8px;
            border: 1px solid rgba(64, 158, 255, 0.2);
            background: linear-gradient(135deg, rgba(64, 158, 255, 0.1) 0%, rgba(64, 158, 255, 0.05) 100%);
            
            .el-alert__title {
                font-weight: 600;
                color: #409eff;
            }
            
            .el-alert__description {
                color: #606266;
                font-size: 14px;
                line-height: 1.5;
            }
        }
    }

    .loading-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
        
        .loading-icon {
            font-size: 32px;
            color: #409eff;
            margin-bottom: 16px;
            animation: spin 1s linear infinite;
        }
        
        p {
            margin: 0;
            color: #6b7280;
            font-size: 14px;
        }
    }

    @keyframes spin {
        from {
            transform: rotate(0deg);
        }
        to {
            transform: rotate(360deg);
        }
    }
    
    // 优化滚动性能
    .cache-monitor,
    .cache-actions,
    .cache-stats {
        will-change: auto;
        transform: translateZ(0); // 启用硬件加速
    }

    .cache-monitor {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        margin-bottom: 30px;
        .monitor-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            h3 {
                margin: 0;
                color: #1f2937;
            }
        }
        .monitor-content {
            .status-section {
                margin-bottom: 20px;
                h4 {
                    margin: 0 0 10px 0;
                    color: #374151;
                }
                .status-grid {
                    display: grid;
                    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
                    gap: 10px;
                }
                .status-item {
                    display: flex;
                    align-items: center;
                    .label {
                        font-size: 14px;
                        color: #6b7280;
                        margin-right: 5px;
                    }
                    .value {
                        font-size: 16px;
                        font-weight: 600;
                        color: #1f2937;
                        &.success {
                            color: #10b981;
                        }
                        &.error {
                            color: #ef4444;
                        }
                    }
                }
            }
            .cache-stats {
                margin-bottom: 20px;
                .stat-item {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    padding: 10px 0;
                    border-bottom: 1px solid #f3f4f6;
                    &:last-child {
                        border-bottom: none;
                    }
                    .label {
                        font-size: 14px;
                        color: #6b7280;
                    }
                    .value {
                        font-size: 16px;
                        font-weight: 600;
                        color: #1f2937;
                    }
                }
            }
            .actions-section {
                margin-bottom: 20px;
                h4 {
                    margin: 0 0 10px 0;
                    color: #374151;
                }
                .action-buttons {
                    display: flex;
                    gap: 10px;
                }
            }
            .details-section {
                margin-top: 20px;
                h4 {
                    margin: 0 0 10px 0;
                    color: #374151;
                }
                .cache-details {
                    max-height: 200px;
                    overflow-y: auto;
                    border: 1px solid #e5e7eb;
                    border-radius: 4px;
                    padding: 10px;
                }
                .cache-item {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    padding: 8px 0;
                    border-bottom: 1px solid #f3f4f6;
                    &:last-child {
                        border-bottom: none;
                    }
                    .cache-key {
                        font-size: 14px;
                        color: #374151;
                        flex: 1;
                        margin-right: 10px;
                    }
                }
            }
            .toggle-details {
                margin-top: 10px;
                text-align: center;
            }
        }
    }
    .cache-stats {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        margin-bottom: 30px;
        h2 {
            margin: 0 0 20px 0;
            color: #1f2937;
        }
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
        }
        .stat-card {
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            h3 {
                margin: 0 0 10px 0;
                color: #374151;
                font-size: 16px;
            }
            .stat-value {
                font-size: 24px;
                font-weight: 600;
                color: #1f2937;
                margin-bottom: 5px;
            }
            .stat-desc {
                color: #6b7280;
                font-size: 14px;
            }
        }
    }
    .cache-config {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        margin-bottom: 30px;
        h2 {
            margin: 0 0 20px 0;
            color: #1f2937;
        }
        .unit {
            margin-left: 10px;
            color: #6b7280;
        }
        .desc {
            margin-left: 10px;
            color: #6b7280;
            font-size: 14px;
        }
    }
    .cache-logs {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        h2 {
            margin: 0 0 20px 0;
            color: #1f2937;
        }
        .logs-container {
            max-height: 300px;
            overflow-y: auto;
            border: 1px solid #e5e7eb;
            border-radius: 4px;
        }
        .log-item {
            display: flex;
            align-items: center;
            padding: 12px;
            border-bottom: 1px solid #f3f4f6;
            &:last-child {
                border-bottom: none;
            }
            &.info {
                border-left: 4px solid #3b82f6;
            }
            &.success {
                border-left: 4px solid #10b981;
            }
            &.warning {
                border-left: 4px solid #f59e0b;
            }
            &.error {
                border-left: 4px solid #ef4444;
            }
            .log-time {
                font-size: 12px;
                color: #6b7280;
                min-width: 150px;
            }
            .log-message {
                flex: 1;
                margin: 0 15px;
                color: #374151;
            }
            .log-type {
                font-size: 12px;
                padding: 2px 8px;
                border-radius: 12px;
                text-transform: uppercase;
                font-weight: 500;
                &.info {
                    background: #dbeafe;
                    color: #1e40af;
                }
                &.success {
                    background: #d1fae5;
                    color: #065f46;
                }
                &.warning {
                    background: #fef3c7;
                    color: #92400e;
                }
                &.error {
                    background: #fee2e2;
                    color: #991b1b;
                }
            }
        }
    }
}